# decompressor function
from bz2 import decompress as d
def dc(c, ln=None):
    return d('BZh91AY&SY'+c)

# set up exceptions generator
from partad import exc
excd = dc(exc)
def excf():
    for c in excd:
        yield c
exc = excf()

# the prediction algorithm
def predict(next):
    if next in ['mit']:
        return 'an'
    if (next[0] not in 'aeio' or next == 'one' or next[:3] == 'eur') and \
       next[:2] not in ['un', 'ur', 'up', 'ul'] and \
       next[:4] not in ['hour'] and \
       next[:5] not in ['honor', 'hones'] and \
       True in [x in next for x in 'aeiou']:
        return 'a'
    if next in [x for x in 'bcdgjkpqtuvwyz'] or \
       next[:4] in ['unio', 'unic'] or \
       next[:5] in ['unite']:
        return 'a'
    if True not in [x in next for x in 'aeiou'] and \
       next[0] in [x for x in 'bcdgjkpqtuvwyz']:
        return 'a'
    return 'an'

# word generator
def fwords():
    from sys import stdin as si
    while 1:
        data = si.read(10240)
        if data == '':
            break
        while data[-1] != ' ':
            pad = si.read(1)
            if pad == '':
                break
            data += pad
        data = data.split(' ')
        if data[-1] == '':
            data = data[:-1]
        for word in data:
            yield word
words = fwords()

word = words.next()
next = words.next()

# write output
from sys import stdout as so
while 1:
    try:
        if word == 'a':
            if exc.next() == '1':
                so.write(predict(next) == 'a' and 'an ' or 'a ')
            else:
                so.write(predict(next) + ' ')
        else:
            so.write(word + ' ')
        word = next
        next = words.next()
    except StopIteration:
        so.write(next)
        break
